package entity

//import com.fasterxml.jackson.annotation.JsonIgnore
import com.sun.istack.NotNull
import javax.persistence.*


//@Entity(name = "auth_r_user_role")
public class Udr {

    var id: Int = -1

//    @JsonIgnore
//    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "user_id")
    var user: User? = null

//    @ManyToOne
//    @JoinColumn(name = "role_id")
    var role: Role? = null
    var note: String? = null

    @NotNull
    override fun toString(): String {
        return "Udr{" +
                "id=" + id +
                ", user=" + user +
                ", role=" + role +
                ", role_id=" + role?.name +
                ", note='" + note + '\'' +
                '}'
    }
}